﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Runtime.Serialization;

namespace Airport
{

    [DataContract]
    // Custom Point class because we can't use System.Drawing
    public class Point : Airport.IPoint, IEquatable<Point>
    {
        private int _x;
        private int _y;

        [DataMember]
        public int X
        {
            get { return _x; }

            set
            {
                if (_x != value)
                {
                    _x = value;
                }
            }
        }

        [DataMember]
        public int Y
        {
            get { return _y; }

            set
            {
                if (_y != value)
                {
                    _y = value;
                }
            }
        }

        public Point()
        {
            _x = 0;
            _y = 0;
        }

        public Point(int x, int y)
        {
            _x = x;
            _y = y;
        }

        public bool Equals(Point other)
        {
            if (this._x == other._x)
                return (this._y == other._y);
            return false;
        }

        /*
        public static bool operator !=(Point left, Point right)
        {
            if (left._x != right._x)
                return (left._y != right._y);
            return false;
        }

        public static bool operator ==(Point left, Point right)
        {
            if (left._x == right._x)
                return (left._y == right._y);
            return false;
        }
        */
    }
    
}